#include "CheckError.h"

bool logMsg(bool x, const char *msg, char* file, unsigned int line)
{
	if( false == x)
	{
#if _DEBUG
		//do that extra logging information to a file etc.
		std::cout<<"On line " <<line<<":";
		std::cout<<" in file " <<file <<":"; 
		std::cout<<" Error !! Assert "<<msg << " failed\n";
#endif
		return (false);
	}
	return(true);
}


void CheckError() 
{
#if _DEBUG
	int error = glGetError();
	std::string message("Error " + std::to_string(static_cast<long long>(error)));

	MY_ASSERT(error == GL_NO_ERROR, message.c_str());
#endif
}